$(deprecated_h_sources)
gdk_private_headers = \
+ gdk-private.h \
gdkapplaunchcontextprivate.h \
gdkcursorprivate.h \
gdkdevicemanagerprivate.h \
gdk_c_sources = \
$(deprecated_c_sources) \
+ gdk-private.c \
gdk.c \
gdkapplaunchcontext.c \
gdkcairo.c \
--- /dev/null
+#include "config.h"
+#include "gdk-private.h"
+
+GdkPrivateVTable *
+gdk__private__ (void)
+{
+ static GdkPrivateVTable table = {
+ gdk_device_grab_info,
+ gdk_display_open_default,
+ gdk_add_option_entries,
+ gdk_pre_parse,
+ };
+
+ return &table;
+}
--- /dev/null
+#ifndef __GDK__PRIVATE_H__
+#define __GDK__PRIVATE_H__
+
+#include <gdk/gdk.h>
+
+#define GDK_PRIVATE_CALL(symbol) (gdk__private__ ()->symbol)
+
+GdkDisplay * gdk_display_open_default (void);
+
+gboolean gdk_device_grab_info (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow **grab_window,
+ gboolean *owner_events);
+
+void gdk_add_option_entries (GOptionGroup *group);
+
+void gdk_pre_parse (void);
+
+typedef struct {
+ /* add all private functions here, initialize them in gdk-private.c */
+ gboolean (* gdk_device_grab_info) (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow **grab_window,
+ gboolean *owner_events);
+
+ GdkDisplay *(* gdk_display_open_default) (void);
+
+ void (* gdk_add_option_entries) (GOptionGroup *group);
+ void (* gdk_pre_parse) (void);
+} GdkPrivateVTable;
+
+GDK_AVAILABLE_IN_ALL
+GdkPrivateVTable * gdk__private__ (void);
+
+#endif /* __GDK__PRIVATE_H__ */
#include "gdkinternals.h"
#include "gdkintl.h"
+#include "gdk-private.h"
+
#ifndef HAVE_XCONVERTCASE
#include "gdkkeysyms.h"
#endif
{ NULL }
};
+void
+gdk_add_option_entries (GOptionGroup *group)
+{
+ g_option_group_add_entries (group, gdk_args);
+}
+
/**
* gdk_add_option_entries_libgtk_only:
* @group: An option group.
*
* Appends gdk option entries to the passed in option group. This is
* not public API and must not be used by applications.
+ *
+ * Deprecated: 3.16: This symbol was never meant to be used outside
+ * of GTK+
*/
void
gdk_add_option_entries_libgtk_only (GOptionGroup *group)
{
- g_option_group_add_entries (group, gdk_args);
+ gdk_add_option_entries (group);
}
void
-gdk_pre_parse_libgtk_only (void)
+gdk_pre_parse (void)
{
const char *rendering_mode;
const gchar *gl_string;
}
}
+/**
+ * gdk_pre_parse_libgtk_only:
+ *
+ * Prepare for parsing command line arguments for GDK. This is not
+ * public API and should not be used in application code.
+ *
+ * Deprecated: 3.16: This symbol was never meant to be used outside
+ * of GTK+
+ */
+void
+gdk_pre_parse_libgtk_only (void)
+{
+ gdk_pre_parse ();
+}
/**
* gdk_parse_args:
if (gdk_initialized)
return;
- gdk_pre_parse_libgtk_only ();
+ gdk_pre_parse ();
option_context = g_option_context_new (NULL);
g_option_context_set_ignore_unknown_options (option_context, TRUE);
return _gdk_display_arg_name;
}
-/**
- * gdk_display_open_default_libgtk_only:
+/*< private >
+ * gdk_display_open_default:
*
* Opens the default display specified by command line arguments or
* environment variables, sets it as the default display, and returns
*
* Returns: (nullable) (transfer none): the default display, if it
* could be opened, otherwise %NULL.
- **/
+ */
GdkDisplay *
-gdk_display_open_default_libgtk_only (void)
+gdk_display_open_default (void)
{
GdkDisplay *display;
return display;
}
+/**
+ * gdk_display_open_default_libgtk_only:
+ *
+ * Opens the default display specified by command line arguments or
+ * environment variables, sets it as the default display, and returns
+ * it. gdk_parse_args() must have been called first. If the default
+ * display has previously been set, simply returns that. An internal
+ * function that should not be used by applications.
+ *
+ * Returns: (nullable) (transfer none): the default display, if it
+ * could be opened, otherwise %NULL.
+ *
+ * Deprecated: 3.16: This symbol was never meant to be used outside
+ * of GTK+
+ */
+GdkDisplay *
+gdk_display_open_default_libgtk_only (void)
+{
+ return gdk_display_open_default ();
+}
+
/**
* gdk_init_check:
* @argc: (inout): the number of command line arguments.
{
gdk_parse_args (argc, argv);
- return gdk_display_open_default_libgtk_only () != NULL;
+ return gdk_display_open_default () != NULL;
}
gint x,
gint y);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
GdkDevice *device,
GdkWindow **grab_window,
#include "gdkdisplay.h"
#include "gdkdisplayprivate.h"
+#include "gdk-private.h"
+
#include "gdkdeviceprivate.h"
#include "gdkdisplaymanagerprivate.h"
#include "gdkevents.h"
}
}
-/**
- * gdk_device_grab_info_libgtk_only:
+/*< private >
+ * gdk_device_grab_info:
* @display: the display for which to get the grab information
* @device: device to get the grab information from
* @grab_window: (out) (transfer none): location to store current grab window
*
* Returns: %TRUE if this application currently has the
* keyboard grabbed.
- **/
+ */
gboolean
-gdk_device_grab_info_libgtk_only (GdkDisplay *display,
- GdkDevice *device,
- GdkWindow **grab_window,
- gboolean *owner_events)
+gdk_device_grab_info (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow **grab_window,
+ gboolean *owner_events)
{
GdkDeviceGrabInfo *info;
return FALSE;
}
+/**
+ * gdk_device_grab_info_libgtk_only:
+ * @display: the display for which to get the grab information
+ * @device: device to get the grab information from
+ * @grab_window: (out) (transfer none): location to store current grab window
+ * @owner_events: (out): location to store boolean indicating whether
+ * the @owner_events flag to gdk_keyboard_grab() or
+ * gdk_pointer_grab() was %TRUE.
+ *
+ * Determines information about the current keyboard grab.
+ * This is not public API and must not be used by applications.
+ *
+ * Returns: %TRUE if this application currently has the
+ * keyboard grabbed.
+ *
+ * Deprecated: 3.16: The symbol was never meant to be used outside
+ * of GTK+
+ */
+gboolean
+gdk_device_grab_info_libgtk_only (GdkDisplay *display,
+ GdkDevice *device,
+ GdkWindow **grab_window,
+ gboolean *owner_events)
+{
+ return gdk_device_grab_info (display, device, grab_window, owner_events);
+}
+
/**
* gdk_display_pointer_is_grabbed:
* @display: a #GdkDisplay
gint y);
#endif /* GDK_MULTIDEVICE_SAFE */
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
GdkDisplay *gdk_display_open_default_libgtk_only (void);
GDK_AVAILABLE_IN_ALL
GDK_AVAILABLE_IN_ALL
gboolean gdk_init_check (gint *argc,
gchar ***argv);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_16
void gdk_pre_parse_libgtk_only (void);
GDK_AVAILABLE_IN_ALL
#include "config.h"
#include "gdk/gdk.h"
+#include "gdk/gdk-private.h"
#include <locale.h>
if (_gtk_module_has_mixed_deps (NULL))
g_error ("GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported");
- gdk_pre_parse_libgtk_only ();
+ GDK_PRIVATE_CALL (gdk_pre_parse) ();
gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, NULL, NULL);
#ifdef G_ENABLE_DEBUG
if (info->open_default_display)
{
- if (gdk_display_open_default_libgtk_only () == NULL)
+ if (GDK_PRIVATE_CALL (gdk_display_open_default) () == NULL)
{
const char *display_name = gdk_get_display_arg_name ();
g_set_error (error,
group = g_option_group_new ("gtk", _("GTK+ Options"), _("Show GTK+ Options"), info, g_free);
g_option_group_set_parse_hooks (group, pre_parse_hook, post_parse_hook);
- gdk_add_option_entries_libgtk_only (group);
+ GDK_PRIVATE_CALL (gdk_add_option_entries) (group);
g_option_group_add_entries (group, gtk_args);
g_option_group_set_translation_domain (group, GETTEXT_PACKAGE);
gboolean retval;
if (gtk_initialized)
- return gdk_display_open_default_libgtk_only () != NULL;
+ return GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
gettext_initialization ();
if (!gtk_parse_args (argc, argv))
return FALSE;
- ret = gdk_display_open_default_libgtk_only () != NULL;
+ ret = GDK_PRIVATE_CALL (gdk_display_open_default) () != NULL;
if (debug_flags & GTK_DEBUG_INTERACTIVE)
gtk_window_set_interactive_debugging (TRUE);
return TRUE;
}
-/* private libgtk to libgdk interfaces */
-gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display,
- GdkDevice *device,
- GdkWindow **grab_window,
- gboolean *owner_events);
-
static void
rewrite_events_translate (GdkWindow *old_window,
GdkWindow *new_window,
display = gdk_window_get_display (event->any.window);
device = gdk_event_get_device (event);
- if (!gdk_device_grab_info_libgtk_only (display, device, &grab_window, &owner_events) ||
+ if (!GDK_PRIVATE_CALL (gdk_device_grab_info) (display, device, &grab_window, &owner_events) ||
!owner_events)
return NULL;
break;